package com.lhkj.ct.base.exception;


import com.lhkj.ct.base.enums.ReturnStatus;

/**
 * <p>
 *     系统服务异常
 * </p>
 */
public class SystemException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private final ReturnStatus DEFAULT_STATUS = ReturnStatus.SC_INTERNAL_SERVER_ERROR;

    private ReturnStatus stateCode = DEFAULT_STATUS;


    public SystemException(String message) {
        super(message);
    }

    public SystemException(ReturnStatus code, String message) {
        super(message);
        this.stateCode = code;
    }

    public SystemException(ReturnStatus code, String message, Throwable cause) {
        super(message, cause);
        this.stateCode = code;
    }

    public SystemException(String message, Throwable cause) {
        super(message, cause);
    }

    public ReturnStatus getStateCode() {
        return this.stateCode;
    }

    public void setStateCode(ReturnStatus stateCode) {
        this.stateCode = stateCode;
    }

}
